/**
 *  Copyright (c) 2011, IPC Studio, USTC, All rights reserved
 *  FileName: Lyrics.h
 *  Author: chengximing1989@gmail.com
 *  DateCreated: 2011-3-23
 *  Brief: class CLyrics definition, used to define some interfaces to be used by its children
 */

#ifndef LYRICS_H_
#define LYRICS_H_

#include "common.h"
#include "TxtEncoder.h"

LIBLYRICS_NAMESPACE_BEGIN

struct LrcRecord
{
	int time;
	string lrctxt;
};

class CLyrics
{
public:
	CLyrics(void);
	virtual ~CLyrics(void);

	virtual bool OpenLyrics(string filename) = 0;								//used to open a lyrics file
	virtual string GetLrctxt(int time) = 0;										//get the lyrics
	vector<string> GetLrcHeadInfo();											//get lyrics tag information
	vector<LrcRecord> GetLrcRecord();											//get lyrics
	bool ClearAll();															//clear all the data of this class
	int Getoffset();															//get the offset time of lyrics
	static string GetLibVersion();												//get the version string

protected:
	TxtEncoder* m_pencoder;
	string m_alllrc;
	FILE* m_plrcfile;
	int m_offset;
	vector<LrcRecord> m_veclrcrec;
	vector<string> m_veclrcheadinfo;
};

LIBLYRICS_NAMESPACE_END
#endif
